# -*-coding:utf-8-*-

import unittest
from tests.apis.http import *
from tests.base import BaseTestCase
import settings
import hashlib
from bson.objectid import ObjectId


class TestPlatformOrdersNds(BaseTestCase):
    def setUp(self):
        self.root_user = self.get_root_user()
        self.root_role = self.get_api_set('roles', access_token=self.root_user.access_token)
        self.vendor_username = '18923365099'
        self.vendor_password = hashlib.md5('Hfs0756').hexdigest()
        roles = self.root_role.get_subordinate_role_list(role_id=settings.root_role_id)
        self.vendor_roles = [roles[0]['role_id']]
        self.root_user.create_member(name='hfs vendor', username=self.vendor_username,
                                     password=self.vendor_password, roles=self.vendor_roles,
                                     appkey=configs.TEST_APP_KEY, specifics={})

        self.vendor = self.get_api_set('users')
        self.vendor.login(self.vendor_username, self.vendor_password)

        self.vendor_role_apis = self.get_api_set('roles', access_token=self.vendor.access_token)
        role_agent_city = self.vendor_role_apis.create_role(name='agent_city', superior_id=self.vendor_roles, grade=3)
        role_agent_district = self.vendor_role_apis.create_role(name='agent_district', superior_id=self.vendor_roles,
                                                                grade=2)

    def test_foo(self):
        pass